#! /bin/sh
url='http://navi.lymtr.cn';
comurl=$url'/rest/computer/sh/';
appurl=$url'/rest/application/sh/';
entryType=$1;
tip='current entryType is ';
if [ $entryType = "a" ] ; then
	echo ${tip}' -> application';
	geturl=${appurl};
else
	echo ${tip}' -> computer';
	geturl=${comurl};
fi  #ifend

read -p "Please input your query num >>>: " number;

rep=$(curl -s ${geturl}${number})

if [ ! -n "$rep" ]; then
	echo '--- information is not found! ---';
	exit 0;
fi  #ifend

#echo ${rep};
array=(${rep// / });

echo 'entry name -> ' ${array[4]};
echo 'dispose loc -> ' ${array[3]};

./i2login.sh 22 ${array[1]} ${array[0]} ${array[2]}

